home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 April / EnigmA AMIGA RUN 17 (1997)(G.R. Edizioni)(IT)[!][issue 1997-04][EAR-CD].iso / EARCD / util / time / Easter.lha / Easter / pascal-version / Easter.pas < prev    next >
Pascal/Delphi Source File  |  1996-04-11  |  1KB  |  40 lines

  1. /* This is the original Easter.Pas  (Pasxa in Greeks) written in 1998 */
  2. /* It's very simply to modify this program to C. It's one minute job! */
  3. /* (c)1998 Alexis Katsadorakis <melody@hol.gr>                        */
  4. /* Dedicated to George Botinis & Ermina Zerba, for these beautiful    */
  5. /* days in programming school.   <Alexis>                             */
  6.  
  7.  
  8. program Easter;
  9. uses crt;
  10. var year,code:integer;
  11.     a1,a2,a3,b1,b2,d,tx:integer;
  12.  
  13. begin
  14. if paramcount=0 then begin
  15.    gotoxy(1,wherey-1);
  16.    writeln('                                                              ');
  17.    gotoxy(1,wherey-1);
  18.    write('ENTER YEAR : ');
  19.    readln(year);
  20. end
  21. else
  22. val(paramstr(1),year,code);
  23.  
  24. if year<0 then begin
  25.    gotoxy(1,wherey-1);writeln('Illegal year. Use years > 0');
  26.    halt;
  27. end;
  28. a1:=year-trunc(year/19)*19;a1:=a1*19+16;
  29. a2:=year-trunc(year/4)*4 ;a2:=a2*2;
  30. a3:=year-trunc(year/7)*7 ;a2:=a2+4*a3;
  31. b1:=a1-trunc(a1/30)*30;
  32. a2:=a2+6*b1;
  33. b2:=a2-trunc(a2/7)*7;
  34. d:=3+b1+b2;
  35. gotoxy(1,wherey-1);clreol;gotoxy(1,wherey);
  36. write('Easter date for ',year,' is : ');
  37. if d<=30 then write(d,' April')
  38. else write(d-30,' May');
  39. end.
  40.